// Copyright 2024 The Google Research Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto2";

package evanet;


// Search space with for EvaNet
message DNASpec {
  // stem params
  // time duration of layer 1
  required int32 time1 = 1;
  // unused (temporal dilation not
  // implemented in TF/cudnn)
  required int32 dilation = 2;
  // conv type for layer 1
  required int32 convop1 = 3;
  // first max-pool time
  required int32 max_pool1_time = 4;
  // third max-pool time
  required int32 max_pool3_time = 5;
  // fourth max-pool time
  required int32 max_pool4_time = 6;

  // block structures
  repeated BlockSpec blocks = 7;
}

message BlockSpec {
  // number of time block is repeated
  // residual connection for each repeat
  required int32 repeats = 1;
  // use non-local layer
  required bool use_nl = 2;
  // parallel layers in block
  repeated Layer layers = 3;
}

message Layer {
  // layer type
  enum LayerType {
    // single conv
    SINGLE_DEFAULT = 0;
    // one conv
    CONV = 1;
    // two convs
    CONV2 = 2;
    // max-pool then conv
    MAXPOOLCONV = 3;
  }

  enum ConvType {
    CONV3D_DEFAULT = 0;
    TGM = 1;
    CONV2P1 = 2;
  }

  // type of this layer
  required LayerType layer_type = 1;
  // conv type (if applicable)
  optional ConvType conv_type = 2;
  // temporal duration of conv/max-pool
  optional int32 time = 3;
  // unused (temporal dilation not supported in current TF/cudnn)
  optional int32 dilation = 4;
  // time of second conv layer
  // if type is CONV2
  optional int32 time2 = 5;
  // not impl. currently
  optional int32 dilation2 = 6;
  // conv type of second conv
  // if type is conv2
  optional ConvType conv_type2 = 7;
}
